using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MatrixDemo
{
    public partial class Form1 : Form
    {
        Transaction[] m_transactions = new Transaction[]
              {
                  new Transaction(new DateTime(1995, 11, 28), "Chris", "Corolla", 4000F),
                  new Transaction(new DateTime(1995, 11, 29), "Brian", "Prius", 2000F),
                  new Transaction(new DateTime(1995, 11, 30), "Chris", "Camry", 5000F),
                  new Transaction(new DateTime(1995, 11, 30), "Jason", "Corolla", 1000F),
                  new Transaction(new DateTime(1995, 12, 1),  "Brian", "Camry",  4000F),
                  new Transaction(new DateTime(1995, 12, 1),  "Chris", "Camry", 2000F),
                  new Transaction(new DateTime(1995, 12, 2),  "Chris", "Corolla", 2500F),
                  new Transaction(new DateTime(1995, 12, 3),  "Jason", "Camry", 1100F),
                  new Transaction(new DateTime(1995, 12, 4),  "Brian", "Corolla", 1200F),
                  new Transaction(new DateTime(1995, 12, 4),  "Jason", "Prius", 1700F),
                  new Transaction(new DateTime(1995, 12, 5),  "Brian", "Corolla", 900F),
                  new Transaction(new DateTime(1995, 12, 6),  "Jason", "Prius", 1300F),
                  new Transaction(new DateTime(1995, 12, 7),  "Chris", "Prius", 2000F),
              };

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.TransactionBindingSource.DataSource = m_transactions;
            this.reportViewer1.RefreshReport();
        }
    }

    public class Transaction
    {
        private string m_salesPerson;
        private string m_product;
        private float m_salePrice;
        private DateTime m_date;

        public Transaction(DateTime date, string salesPerson, string product, float salePrice)
        {
            m_date = date;
            m_salesPerson = salesPerson;
            m_product = product;
            m_salePrice = salePrice;
        }

        public DateTime Date
        {
            get { return m_date; }
            set { m_date = value; }
        }

        public string SalesPerson
        {
            get { return m_salesPerson; }
            set { m_salesPerson = value; }
        }

        public string Product
        {
            get { return m_product; }
            set { m_product = value; }
        }

        public float SalePrice
        {
            get { return m_salePrice; }
            set { m_salePrice = value; }
        }
    }
}